
export const loginAction = (username)=>{
    return (dispatch)=>{              //返回的函数，会调用这个函数
        fetch('http://39.96.84.223:4567/verify/adminlogin',{
            method:'post',
            body:JSON.stringify(username)
        })
        .then(res=>res.json())
        .then(res=>{
            dispatch({type:'login',value:true}) //派发跳入store
        })

    }
}